//
//  BaseInfoThreeCell.m
//  JinFuThree
//
//  Created by 毛韶谦 on 2018/9/3.
//  Copyright © 2018年 毛韶谦. All rights reserved.
//

#import "BaseInfoThreeCell.h"

@interface BaseInfoThreeCell ()

@property (nonatomic, strong) UILabel *tiJiaoLabel;

@end

@implementation BaseInfoThreeCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.contentView.backgroundColor = ListMaoBackgroundColor;
        UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
        [self.contentView addSubview:button];
        [button mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.right.mas_equalTo(self.contentView);
            make.height.mas_equalTo(30);
        }];
        
        [self.tiJiaoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView.mas_left).offset(20);
            make.bottom.mas_equalTo(self.contentView.mas_bottom);
            make.right.mas_equalTo(self.contentView.mas_right).offset(-20);
            make.top.mas_equalTo(button.mas_bottom);
        }];
        
        CAGradientLayer *gradientLayer = [CAGradientLayer layer];
        gradientLayer.colors = @[(__bridge id)HexColor(0xD6C096).CGColor, (__bridge id)HexColor(0xBEA471).CGColor];
        gradientLayer.locations = @[@0, @1];
        gradientLayer.startPoint = CGPointMake(0, 1);
        gradientLayer.endPoint = CGPointMake(1, 1);
        gradientLayer.frame = CGRectMake(0, 0, ScreenWidthMao - 40, 45);
        gradientLayer.cornerRadius = 4;
        gradientLayer.masksToBounds = YES;
        [self.tiJiaoLabel.layer addSublayer:gradientLayer];
        
        self.tiJiaoLabel.alpha = 0.5;
    }
    return self;
}

- (void)updateTiJiaoUI {
    
    self.tiJiaoLabel.alpha = 1;
}

- (UILabel *)tiJiaoLabel {
    
    if (!_tiJiaoLabel) {
        _tiJiaoLabel = [[UILabel alloc] init];
        _tiJiaoLabel.text = @"提 交";
        _tiJiaoLabel.font = [UIFont systemFontOfSize:15];
        [_tiJiaoLabel setTextAlignment:NSTextAlignmentCenter];
        _tiJiaoLabel.textColor = [UIColor whiteColor];
        
        [self.contentView addSubview:_tiJiaoLabel];
    }
    return _tiJiaoLabel;
}


- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
